* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
    color: #333;
}

/* 遮罩层优化 */
.cover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    z-index: -1;
}

/* 主容器优化 */
.client-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

.main {
    display: flex;
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* 左侧区域优化 */
.left {
    width: 320px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 18px;
    color: #495057;
    display: flex;
    align-items: center;
}

.user::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #28a745;
    border-radius: 50%;
    margin-right: 10px;
}

.search {
    padding: 15px;
    display: flex;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

#search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    outline: none;
    transition: all 0.3s;
}

#search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.search button {
    width: 40px;
    height: 40px;
    margin-left: 10px;
    border: none;
    border-radius: 50%;
    background: #667eea;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
}

.search button:hover {
    background: #5a6fd8;
    transform: scale(1.05);
}

.search button::after {
    content: "🔍";
    font-size: 16px;
}

/*.tab {*/
/*    display: flex;*/
/*    background: white;*/
/*    border-bottom: 1px solid #e9ecef;*/
/*}*/

/*.tab-session, .tab-friend {*/
/*    flex: 1;*/
/*    padding: 15px;*/
/*    text-align: center;*/
/*    cursor: pointer;*/
/*    font-weight: 500;*/
/*    transition: all 0.3s;*/
/*    position: relative;*/
/*}*/

/*.tab-session.active, .tab-friend.active {*/
/*    color: #667eea;*/
/*}*/

/*.tab-session.active::after, .tab-friend.active::after {*/
/*    content: "";*/
/*    position: absolute;*/
/*    bottom: 0;*/
/*    left: 50%;*/
/*    transform: translateX(-50%);*/
/*    width: 60%;*/
/*    height: 3px;*/
/*    background: #667eea;*/
/*    border-radius: 3px;*/
/*}*/



/* 标签页样式优化 - 支持图标切换 */
.tab {
    display: flex;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.tab-session, .tab-friend {
    flex: 1;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 图标容器 */
.tab-icon {
    width: 32px;
    height: 32px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: all 0.3s;
}

/* 默认图标状态 */
.tab-session .tab-icon {
    background-image: url('../img/对话2.png');
}

.tab-friend .tab-icon {
    background-image: url('../img/用户2.png');
}

/* 激活状态的图标 */
.tab-session.active .tab-icon {
    background-image: url('../img/对话.png');
}

.tab-friend.active .tab-icon {
    background-image: url('../img/用户.png');
}

/* 激活状态的文字颜色 */
.tab-session.active, .tab-friend.active {
    color: #667eea;
}

.tab-session.active::after, .tab-friend.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: #667eea;
    border-radius: 3px;
}


.list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    list-style: none;
}

.list li {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.list li:hover {
    background: #e9ecef;
}

.list li.selected {
    background: #e3f2fd;
    border-left: 3px solid #667eea;
}

.list li h3, .list li h4 {
    margin-bottom: 5px;
    font-weight: 600;
}

.list li p {
    color: #6c757d;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-request {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.request-content {
    flex: 1;
}

.request-actions {
    display: flex;
    gap: 8px;
}

.accept-btn, .reject-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.accept-btn {
    background: #28a745;
    color: white;
}

.accept-btn:hover {
    background: #218838;
}

.reject-btn {
    background: #dc3545;
    color: white;
}

.reject-btn:hover {
    background: #c82333;
}

.hide {
    display: none;
}

/* 右侧区域优化 */
.right {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.title {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 18px;
    color: #495057;
}

.message-show {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin-bottom: 15px;
    display: flex;
}

.message-left {
    justify-content: flex-start;
}

.message-right {
    justify-content: flex-end;
}

.box {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message-left .box {
    background: white;
    border-bottom-left-radius: 4px;
}

.message-right .box {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.box h4 {
    font-size: 14px;
    margin-bottom: 5px;
    opacity: 0.8;
}

.box p {
    margin: 0;
    line-height: 1.4;
}

/* 搜索结果样式 */
.chat-session-module {
    margin-bottom: 15px;
}

.chat-session-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-btn {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.chat-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.add-friend-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
}

.friend-info {
    margin-bottom: 15px;
}

.username {
    font-weight: 600;
    color: #495057;
}

.form-group {
    margin-bottom: 15px;
}

#add-reason {
    width: 100%;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    transition: all 0.3s;
}

#add-reason:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    outline: none;
}

.send-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.send-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.message-input {
    height: 100px;
    padding: 15px;
    border: none;
    border-top: 1px solid #e9ecef;
    resize: none;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

.message-input:focus {
    border-top-color: #667eea;
    box-shadow: 0 -2px 5px rgba(102, 126, 234, 0.1);
}

.ctrl {
    padding: 15px;
    text-align: right;
    background: white;
    border-top: 1px solid #e9ecef;
}

.ctrl button {
    padding: 10px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.ctrl button:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main {
        flex-direction: column;
        height: 100vh;
        border-radius: 0;
    }

    .left {
        width: 100%;
        height: 40%;
    }

    .right {
        height: 60%;
    }
}
